#!/bin/bash

# 卸载旧版本的Docker
yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-selinux \
                  docker-engine-selinux \
                  docker-engine \
                  docker-ce


rm -rf /etc/docker
rm -rf /run/docker
rm -rf /var/lib/dockershim

# 删除docker的镜像文件
rm -rf /var/lib/docker

# 关掉进程
#ps -ef|grep docker|grep -v grep|xargs kill -s 9

# 卸载docker相关包
yum remove docker-*

yum remove docker-ce-cli-*
yum remove docker-scan-plugin*

# 删除旧版docker-compose
rm -rf /usr/local/bin/docker-compose
rm -rf /usr/bin/docker-compose